# Maintainer: GH Cao

_realname=sse2neon
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=1.8.0
pkgrel=1
pkgdesc="sse2neon - A translator from Intel SSE intrinsics to Arm/Aarch64 NEON implementation (mingw-w64)"
arch=('any')
mingw_arch=('clangarm64')
url='https://github.com/DLTcollab/sse2neon'
license=('spdx:MIT')
source=("https://github.com/DLTcollab/${_realname}/archive/v${pkgver}/${_realname}-${pkgver}.tar.gz"
        "001-Fix-mismatched-_mm_-malloc-free-with-LLVM-MinGW.patch::https://github.com/DLTcollab/sse2neon/commit/f30790d6.patch")
sha256sums=('e251746e3b761f3f0de1ad462b1efe53532341b6b0498d394765fceb85ce8a46'
            '9f689b7c57e67eed672cfe37ce222286d5dfaa9c4f70a22215b4a3ae68228f27')

prepare() {
  cd ${_realname}-${pkgver}
  patch -p1 -i "${srcdir}"/001-Fix-mismatched-_mm_-malloc-free-with-LLVM-MinGW.patch
}

package() {
  cd "${srcdir}/${_realname}-${pkgver}"

  install -Dm644 "${srcdir}/${_realname}-${pkgver}/sse2neon.h" \
    "${pkgdir}${MINGW_PREFIX}/include/${_realname}/sse2neon.h"

  install -Dm644 "${srcdir}/${_realname}-${pkgver}/LICENSE" \
    "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE"
}
